package com.shujia.wyh.day18;

public class EnumDemo4 {
    public static void main(String[] args) {
        Season4 fall = Season4.FALL;
        fall.activity();
    }
}

interface Activity2{
    void activity();
}


enum Season4 implements Activity2{
    //3、在枚举类中创建对象，因为外界无法创建对象，又想让外界获取，所以改成静态的，可以直接通过类名访问
    //在enum修饰的枚举类中必须放在第一个位置。！！
    SPRING("春天", "春暖花开"){
        @Override
        public void activity() {
            System.out.println("放风筝");
        }
    },
    SUMMER("夏天", "烈日炎炎"){
        @Override
        public void activity() {
            System.out.println("夏天吃西瓜");
        }
    },
    FALL("秋天", "秋高气爽"){
        @Override
        public void activity() {
            System.out.println("秋天秋游");
        }
    },
    WINTER("冬天", "白雪皑皑"){
        @Override
        public void activity() {
            System.out.println("冬天滑雪");
        }
    };

    //2、创建枚举类的属性（成员变量）,外界不能去修改也不能进行直接获取
    private final String SEASON_NAME;
    private final String SEASON_DESC;


    //1、必须将构造方法私有化，这样做的目的是为了保证类的对象是有限个的
    private Season4(String SEASON_NAME, String SEASON_DESC) {
        this.SEASON_NAME = SEASON_NAME;
        this.SEASON_DESC = SEASON_DESC;
    }



    //4、提供公共的方法获取属性
    public String getSEASON_NAME() {
        return SEASON_NAME;
    }

    public String getSEASON_DESC() {
        return SEASON_DESC;
    }

//    @Override
//    public void activity() {
//        System.out.println("好好学习天天向上");
//    }
}

